package de.baumann.browser.fragments


import android.support.v7.widget.LinearLayoutManager
import android.view.View
import de.baumann.browser.R
import de.baumann.browser.adapter.HashOrderAdapter
import de.baumann.browser.api.net.vo.PayParam
import de.baumann.browser.base.BaseOdinFragment
import de.baumann.browser.iview.IOrderListView
import de.baumann.browser.present.HashOrderPresenter
import de.baumann.browser.utils.ViewUtil
import kotlinx.android.synthetic.main.fragment_base_hash_order.*

/**
 *@author:
 *@date:2019/1/7 10:15
 *@discription: 算力包订单基类
 */
abstract class BaseHashOrderFragment : BaseOdinFragment<IOrderListView, HashOrderPresenter>(), IOrderListView {

    lateinit var hashOrderAdapter: HashOrderAdapter

    override fun getLayout(): Int {
        return R.layout.fragment_base_hash_order
    }

    override fun initView(view: View) {
        rvHashOrder.layoutManager = LinearLayoutManager(context)
        hashOrderAdapter = getAdapter()
        rvHashOrder.adapter = hashOrderAdapter
        hashOrderAdapter.emptyView = ViewUtil.emptyView(mContext)
    }

    override fun createPresenter(): HashOrderPresenter {
        return HashOrderPresenter()
    }

    override fun createView(): IOrderListView {
        return this
    }


    abstract fun getAdapter(): HashOrderAdapter


    override fun getPayId(): String {
        return ""
    }

    override fun paySuccess() {
    }

    override  fun wxPay(payParam: PayParam?) {
    }


    override fun onDestroyView() {
         super.onDestroyView()
    }

}
